import {request} from "@/axios/index"

const url="/user"

export function login(username,password){
	console.log("username,password:",username,typeof password);
	return request({
		url:url+"/login",
		method:"post",
		data:{username,password},
	}).then((res)=>{
		return res
	})
}

export function reg(username,password){
	return request({
		url:url+"/reg",
		method:"post",
		data:{username,password},
	}).then((res)=>{
		return res
	})
}

export function isLogin(){
	return request({
		url:url+"/isLogin",
		method:"get"
	}).then((res)=>{
		return res
	})
}
export function getUserInfo(){
	return request({
		url:url+"/getUserInfo",
		method:"get"
	}).then((res)=>{

		return res
	})
}